//
//  DetailsOfMeetingFromFootView.m
//  Gxj
//
//  Created by 刘伟 on 2017/9/19.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "DetailsOfMeetingFromFootView.h"

@implementation DetailsOfMeetingFromFootView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self addSubview:self.commentaries];
        [self addSubview:self.collect];
        [self addSubview:self.grabBtn];
        [self showDetailsFromFootView];
    }
    return self;
}

- (void)showDetailsFromFootView
{
    _commentaries.sd_layout
    .topSpaceToView(self,kHeightScale(5))
    .leftSpaceToView(self,kWidthScale(40))
    .widthIs(kWidthScale(23))
    .heightIs(kHeightScale(39));
    
    _collect.sd_layout
    .topEqualToView(self.commentaries)
    .leftSpaceToView(self.commentaries,kWidthScale(65))
    .widthIs(kWidthScale(23))
    .heightIs(kHeightScale(39));
    
    _grabBtn.sd_layout
    .topSpaceToView(self,0)
    .rightSpaceToView(self,0)
    .leftSpaceToView(self.collect,kWidthScale(40))
    .bottomSpaceToView(self,0);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (JXButton *)commentaries
{
    if (!_commentaries)
    {
        _commentaries = [JXButton buttonWithType:UIButtonTypeCustom];
        [_commentaries setTitle:@"评论" forState:0];
        [_commentaries setTitleColor:[UIColor colorWithRed:122.0/255.0 green:122.0/255.0 blue:122.0/255.0 alpha:1] forState:0];
        [_commentaries setImage:[UIImage imageNamed:@"pinlun"] forState:0];
    }
    return _commentaries;
}

- (JXButton *)collect
{
    if (!_collect)
    {
        _collect = [JXButton buttonWithType:UIButtonTypeCustom];
        [_collect setTitle:@"点赞" forState:0];
        [_collect setTitleColor:[UIColor colorWithRed:122.0/255.0 green:122.0/255.0 blue:122.0/255.0 alpha:1] forState:0];
        [_collect setImage:[UIImage imageNamed:@"zantonghi"] forState:0];
    }
    return _collect;
}

- (UIButton *)grabBtn
{
    if (!_grabBtn)
    {
        _grabBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_grabBtn setBackgroundImage:[UIImage imageNamed:@"qiangweihi"] forState:0];
//        [_grabBtn setImage:[UIImage imageNamed:@"qiangweihi"] forState:0];
        _grabBtn.contentMode = UIViewContentModeScaleAspectFit;
    }
    return _grabBtn;
}

@end
